package com.mspbots.core.wise.controller;

import com.mspbots.core.AbstractBaseController;
import com.mspbots.core.wise.model.TenantTimedoctor;
import com.mspbots.core.wise.service.TenantTimedoctorService;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.concurrent.Callable;


/**
 * com.mspbots.core.controller.TenantManagerController
 *
 * @author Jun Zhou
 * @date 12:09 2019/6/28
 **/
@RestController
@RequestMapping("tenant/timedoctor")
public class TenantTimedoctorController extends AbstractBaseController<TenantTimedoctor, TenantTimedoctorService> {

    @Override
    @PutMapping(path = "/{id}")
    public Callable update(@RequestBody TenantTimedoctor entity) {
        return () -> {
            entity.setUpdatedTime(LocalDateTime.now());
            service.updateById(entity);
            return entity;
        };
    }
}
